using System;
using System.Collections.Generic;
using UnityEngine;

public class FallingSaver : MonoBehaviour
{
	public float m_FallenTooFar = -40f;

	private Vector3 m_HomePos;
	private Quaternion m_HomeRot;

	void Start()
	{
		m_HomePos = new Vector3( transform.position.x, transform.position.y, transform.position.z );
		m_HomeRot = new Quaternion( transform.rotation.x, transform.rotation.y, transform.rotation.z, transform.rotation.w );
	}
	
	void Update()
	{
		if ( transform.position.y < m_FallenTooFar )
		{
			transform.position = m_HomePos; 
			transform.rotation = m_HomeRot;
		}
	}
	
}
